﻿using System.ComponentModel;

namespace LPLS.Commons.DBModule
{
    /// <summary>
    /// 枚举类型，表示不同的数据库键值后期按照模块ID去区分不同的数据库
    /// </summary>
    public enum DatabaseEnum
    {
        //[Description("SqlServer1")]
        //SqlServer1,

        //[Description("SqlServer2")]
        //SqlServer2,

        //[Description("MySql1")]
        //MySql1,

        //[Description("MySql2")]
        //MySql2,

        //[Description("Sqlite1")]
        //Sqlite1,

        //[Description("Sqlite2")]
        //Sqlite2,
        [Description("配置信息")]
        SqliteConfig,
        [Description("数据采集结果DB")]
        CollectionDataResult,
        [Description("数据采集配置DB")]
        CollectionConfigDB,
        [Description("隆基新西咸项目DB")]
        LongGiDB,



    }

   
    /// <summary>
    /// 扩展方法用于获取枚举的描述字符串
    /// </summary>
    public static class EnumExtensions
    {
        public static string GetDescription(this Enum value)
        {
            var fieldInfo = value.GetType().GetField(value.ToString());
            var attributes = (DescriptionAttribute[])fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
            return attributes.Length > 0 ? attributes[0].Description : value.ToString();
        }
    }
}